package com.wangdong.network;

import android.app.Application;

import com.wangdong.network.http.CMBaseSender;
import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.https.HttpsUtils;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;


/**
 * 作者：wangdong on 2018/4/25 11:28
 * 邮箱：2100520956@qq.com
 */

public class App extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        HttpsUtils.SSLParams sslParams = HttpsUtils.getSslSocketFactory(null, null, null);

        OkHttpClient okHttpClient = new OkHttpClient.Builder()
//                .addInterceptor(new LoggerInterceptor("TAG"))
                .connectTimeout(10000L, TimeUnit.MILLISECONDS)
                .readTimeout(10000L, TimeUnit.MILLISECONDS)
                //其他配置
                .build();

        OkHttpUtils.initClient(okHttpClient);


        CMBaseSender.init();
        BaseRequest request=new BaseRequest();
        request.setVersion("1.0");

        CMBaseSender.addParams(request);
    }
}
